BlueSpray - Help
© SchoonerTurtles, Inc. 2012-2015

Introduction
Contents
Getting Started
Download
Navigating
Tutorials
Scripting
Advanced
About

Class STContent

Extends STBase

This is the base class for content that appears in a tree. While this is a rather

large class it is also built to be lightweight and nothing is initialized unless it

is needed.



This class handles all inserting and deleting of content in the list and it is

important that this is not violated as there is data cached based on the list

to allow fast access to the list as an array. The only functions to modify

the list pointers are:

- InsertContentBefore(...)

- InsertContentAfter(...)

- InsertContentAtStart(...)

- InsertContentAtEnd(...)

- RemoveContent(...)



The class provides the following capabilities to objects:





  • Appear in the project tree


  • Contain child objects


  • Add property panels to the properties dialogs


  • Obtain general textural information from objects


  • Get an icon for an object's tree element


  • Lock and unlock objects for threads to access them safely


  • Support Drag n Drop


  • Support selection


  • Support popup-menus






And provides the ability for objects to:



  • Appear in the project tree


  • Contain child objects








Implementation note: This class does not use the standard java List class because

it was faster and was a smaller memory foot print to implement this class as a node

in a list. The list is doubly-linked and this object has pointers to the start

and end of the list.



Copyright, SchoonerTurtles LLP, 2009

@author Jim Graham

Object Functions

Inherited From: STBase
ReturnsFunctionThrows
STContent GetFirstContent(Class ClassType,boolean SelectedOnly)  
STContent GetLastContent(Class ClassType,boolean SelectedOnly)  
STContent GetNextContent(STContent TheCurrent,Class ClassType,boolean SelectedOnly)  
STContent GetPreviousContent(STContent TheCurrent,Class ClassType,boolean SelectedOnly)  
InsertContentAtEnd(STContent TheContent) Exception
boolean Lock(float WaitSeconds,boolean RepaintTree) Exception
STContent LockFirstContent(float WaitSeconds,boolean RepaintTree,Class ClassType,
     boolean SelectedOnly)
Exception
STContent LockNextContent(STContent TheCurrent,float WaitSeconds,boolean RepaintTree,
     Class
ClassType,boolean SelectedOnly)
Exception
RemoveContent(STContent TheContent,boolean Deallocate) Exception
Unlock(boolean RepaintTree) Exception

Object Functions


STContent GetFirstContent(Class ClassType,boolean SelectedOnly)  

Returns the first item in this object that matches the specified criteria
Note: Should only be called if the content does not need to be locked.

Parameters:
    ClassType - the desired class type from the content or null for all
    SelectedOnly - true to only return selected content
Returns:


STContent GetLastContent(Class ClassType,boolean SelectedOnly)  

Get the last content in the list.

Parameters:
    ClassType - the desired class type from the content or null for all
    SelectedOnly - true to only return selected content
Returns:


STContent GetNextContent(STContent TheCurrent,Class ClassType,boolean SelectedOnly)  

Return the content after the specified one that matches the criteria
Note: Should only be called when the content does not need to be locked.

Parameters:
    TheCurrent - the content returned will be the one right after this or null if there are no more.
    ClassType - the desired class type from the content or null for all
    SelectedOnly - true to only return selected content
Returns:


STContent GetPreviousContent(STContent TheCurrent,Class ClassType,boolean SelectedOnly)  

Return the content before the specified one that matches the criteria
Note: Should only be called when the content does not need to be locked.

Parameters:
    TheCurrent - the content returned will be the one right after this or null if there are no more.
    ClassType - the desired class type from the content or null for all
    SelectedOnly - true to only return selected content
Returns:


InsertContentAtEnd(STContent TheContent) Exception

Insert the specified content at the end of the list.

Parameters:
    TheContent - The Content to be inserted
Throws: Exception


boolean Lock(float WaitSeconds,boolean RepaintTree) Exception

Lock for anything other than painting.

if (Lock(true)
{
try
{
...work with the content
}
finally { Unlock(); }

Parameters:
    WaitSeconds - the amount of time to wait in sectons. 0 will


STContent LockFirstContent(float WaitSeconds,boolean RepaintTree,Class ClassType,
     boolean SelectedOnly) Exception

Locks the first content of the type specified.

Parameters:
    WaitSeconds - number of seconds to attempt the lock, 0 for forever
    RepaintTree - false to keep the tree from repainting. This should only


STContent LockNextContent(STContent TheCurrent,float WaitSeconds,boolean RepaintTree,
     Class ClassType,boolean SelectedOnly) Exception

Attempts to lock and return the content after TheCurrentContent that meets the specified
parameters.

Parameters:
    TheCurrent
    WaitSeconds - number of seconds to attempt the lock, 0 for forever
    RepaintTree - false to keep the tree from repainting. This should only


RemoveContent(STContent TheContent,boolean Deallocate) Exception

Removes content from this object. This is the only function that removes
content from the list.

Parameters:
    TheContent - The Content to be deleted
    Deallocate - true to have the removed content deallocate all it's internal memory


Unlock(boolean RepaintTree) Exception

Unlocks this content.

Parameters:
    RepaintTree - true to repaint the tree. This should match the value